package org.wso2.carbon.identity.entitlement.axis2handler;

import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;

/**
 * Created by IntelliJ IDEA.
 * User: pushpalanka
 * Date: 6/2/11
 * Time: 9:55 AM
 * To change this template use File | Settings | File Templates.
 */
public class XACMLElementBuilder {

    String attributeId = null;
    String dataType = null;
    String attributeValue = null;
    private OMNamespace nameSpace;


    /*
    Create an attribute OMElement with the given values
     */
    OMElement createAttribute(String attributeId, String dataType, String value , OMNamespace nameSpace){

        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMElement attributeElement = factory.createOMElement("Attribute", null);
        attributeElement.addAttribute("AttributeId" , attributeId, null);
        attributeElement.addAttribute("DataType" , dataType, null);
        OMElement valueElement = factory.createOMElement("AttributeValue", null);
        valueElement.setText(value);
        attributeElement.addChild(valueElement);


        return attributeElement;
    }



}
